﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Matrix.Common.Utility.EnumToos;
using Matrix.MaKaYunShang.Model.Enum;

namespace Matrix.MaKaYunShang.Model.DataStatisticsModels
{
    public class DataStatShopOrders
    {
        /// <summary>
        /// 店铺名称
        /// </summary>
        [DataMember(Name = "ShopName")]
        [Display(Name = "店铺名称")]
        [Description("店铺名称")]
        public string ShopName { get; set; }

        /// <summary>
        /// 统计时间
        /// </summary>		
        [DataMember(Name = "OrderDate")]
        [Display(Name = "统计时间")]
        [Description("统计时间")]
        public string OrderDate { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        [DataMember(Name = "OrderStatus")]
        [Display(Name = "订单状态")]
        [Description("订单状态")]
        public int OrderStatus { get; set; }

        /// <summary>
        /// 订单状态描述
        /// </summary>
        [DataMember(Name = "OrderStatusDesc")]
        [Display(Name = "订单状态描述")]
        [Description("订单状态描述")]
        public string OrderStatusDesc {
            get
            {
                if (System.Enum.IsDefined(typeof (CommonEnum.OrderStatus), OrderStatus))
                {
                    var orderStatusEnum =
                        (CommonEnum.OrderStatus) System.Enum.ToObject(typeof (CommonEnum.OrderStatus), OrderStatus);

                    return orderStatusEnum.GetDescription();
                }
                if (OrderStatus == -1)
                    return "全部";
                return "未知状态";
            }
        }

        /// <summary>
        /// 支付方式
        /// </summary>		
        [DataMember(Name = "PayWayDesc")]
        [Display(Name = "支付方式")]
        [Description("支付方式")]
        public string PayWayDesc { get; set; }

        /// <summary>
        /// 订单数
        /// </summary>
        [DataMember(Name = "OrderAmount")]
        [Display(Name = "订单数")]
        [Description("订单数")]
        public int OrderAmount { get; set; }

        /// <summary>
        /// 订单总价
        /// </summary>
        [DataMember(Name = "TotalPrice")]
        [Display(Name = "订单总价")]
        [Description("订单总价")]
        public decimal TotalPrice { get; set; }
    }
}
